<?php
	$num=$contact[0]->hotline;
	$num_2=substr($num,4);
	$num_1=substr($num,0,4);
	$user=$this->session->userdata('ProfileInfo');
	$cart=$this->session->userdata('Cart');
?>
<div class="logo">
    <a href="<?=PATH_URL?>">
        <img src="<?=PATH_URL.'static/'?>images/logo.gif" width="231" height="130"/>
    </a>
</div>

<div class="profile">
    <div class="lore">
    	<?php if($user){?>
        <figure>
              <figcaption>
			  		<?=$user['email'];?>
              		<ul>
                    	<li><a href="<?=PATH_URL.'thong-tin-ca-nhan/'.$user['id'].''?>">Thông tin cá nhân</a></li>
                        <li><a href="<?=PATH_URL.'thong-tin-don-hang/'.$user['id'].''?>">Thông tin đơn hàng</a></li>
                        <li><a href="<?=PATH_URL.'profile/logout/'?>">Thoát</a></li>
                    </ul>
              </figcaption>
        </figure> 
        <?php }else{?>
        <a href="<?=PATH_URL.'profile/'?>">Đăng nhập / Đăng ký</a>
        <?php }?>
    </div>
    <img src="<?=PATH_URL.'static/'?>images/line.png" width="271" height="10" />
</div>

<div class="phone_header">
    <span><?=$num_1?></span> <?=$num_2?>
</div>

<div class="search">
    <form name="" id="" method="post">
        <input type="text" value="" name="keySearch" id="keySearch" onkeypress="return searchProducts(event)"/>
        <input type="submit" value="" onclick="searchProducts(0); return false;"/>
    </form>
</div>

<div class="cart_home" id="CartProducts">
    <span>
        <a href="<?=PATH_URL.'gio-hang'?>"><?php	
        	if($cart){
				$shop=rtrim($cart['shop'],'|');
				$arrShop=explode('|',$shop);
				$n=count($arrShop);	
				$tong='';
				for($i=0;$i<$n;$i++){
					$arrTmp=explode(',',$arrShop[$i]);
					$tong +=$arrTmp[1];
				}
				print $tong;
			}else{
				print '0';	
			}
		?></a>
    </span>
</div>